/*
 * @Description  : 
 * @Author       : zhao
 * @Date         : 2022-07-07 08:43:02
 * @LastEditors  : zhao
 * @LastEditTime : 2023-02-02 08:54:08
 */
/*
 * @Description: 借阅车
 * @Author: zhao
 * @Date: 2022-07-07 08:43:02
 * @LastEditors: zhao
 * @LastEditTime: 2022-07-07 09:49:04
 */
import { AddBorrowingCar, GetBorrowingCar, DeleteBorrowingCarAll, DeleteBorrowingCarFile, GetIsValid } from '@/api/Borrowing'
import { MessageBox, Message } from 'element-ui'
const state = {

}

const mutations = {


}

const actions = {
    //加入借阅车
    addBorrowingCar({ commit }, data) {
        return new Promise((resolve, reject) => {
            AddBorrowingCar(data).then(res => {
                resolve(res)
            }).catch(error => {

                reject(error)
            })
        })
    },
    //查询借阅车
    getBorrowingCar({ commit }, data) {
        return new Promise((resolve, reject) => {
            GetBorrowingCar(data).then(res => {

                resolve(res)
            }).catch(err => {
                reject(err)
            })
        })
    },
    //删除文件
    deleteBorrowingCarFile({ commit }, data) {
        return new Promise((resolve, reject) => {
            DeleteBorrowingCarFile(data).then(res => {
                resolve(res)
            }).catch(error => {

                reject(error)
            })
        })
    },
    //清空借阅车
    deleteBorrowingCarAll({ commit }, data) {
        return new Promise((resolve, reject) => {
            DeleteBorrowingCarAll(data).then(res => {
                resolve(res)
            }).catch(error => {

                reject(error)
            })
        })
    },
    //查询借阅车档案是否有效
    GetIsValid({ commit }, data) {
        return new Promise((resolve, reject) => {
            GetIsValid(data).then(res => {
                resolve(res)
            }).catch(error => {

                reject(error)
            })
        })
    },
}
const getters = {

}
export default {
    namespaced: true,
    state,
    mutations,
    getters,
    actions
}
